<template>
	<view class="content">
		<!-- <view class="place" :style="stausStyle">

		</view> -->
		<swiper :indicator-dots="false" :autoplay="true" :interval="5000" :duration="1000" :circular="true">
			<swiper-item v-for="(item,index) in banner" :key="item.id">
				<view class="swiper-item">
					<image :src="item.url | getImg" mode="aspectFill"></image>
				</view>
			</swiper-item>
		</swiper>
		<view class="jg-area">
			<view class="item" @click="noFun">
				<image src="/static/icon/icon1.png" mode="widthFix"></image>
				我要洗车
			</view>
			<view class="item" @click="toOrder">
				<image src="/static/icon/icon2.png" mode="widthFix"></image>
				洗车订单
			</view>
			<view class="item" @click="toPage('/pages/bind/car')">
				<image src="/static/icon/icon3.png" mode="widthFix"></image>
				绑定车牌
			</view>
			<view class="item" @click="toPage('/pages/msg/index')">
				<image src="/static/icon/icon4.png" mode="widthFix"></image>
				最新消息
			</view>
		</view>
		<view class="hotitle">
			<image src="/static/icon/huo.png" mode="widthFix"></image>
			推荐服务
		</view>
		<view class="hotlist">
			<view class="no-list" v-if="list.length == 0">
				- 尚未推出专属的推荐服务，敬请期待 -
			</view>
			<view class="hot-item" v-for="(item,index) in list" :key="index">
				<view class="title">
					晶彩汽车美容工坊
				</view>
				<view class="info">
					<view class="imgbox">
						<image :src="item.img" mode="aspectFill"></image>
					</view>
					<view class="infobox">
						<view class="tips">
							<uni-icons type="shop"></uni-icons>
							<text>12小时营业</text>
						</view>
						<view class="tips">
							<uni-icons type="calendar"></uni-icons>
							<text>时长{{item.time}}分钟</text>
						</view>
						<view class="tablist">
							<text>大功率吸尘</text>
							<text>驱水镀膜</text>
							<text>免费玻璃水</text>
							<text>万能泡沫啧剂</text>
							<text>铁锈去除</text>
							<text>油漠去除</text>
						</view>
					</view>
				</view>
				<view class="price">
					<view class="ptitle">
						收费标准
					</view>
					<view class="priceline">
						<uni-table border stripe emptyText="暂无更多数据">
							<!-- 表头行 -->
							<uni-tr>
								<uni-th align="center">服务项目</uni-th>
								<uni-th align="center">收费详情</uni-th>
							</uni-tr>
							<!-- 表格数据行 -->
							<uni-tr>
								<uni-td align="center">普洗(轿车)</uni-td>
								<uni-td align="center">￥30</uni-td>
							</uni-tr>
							<uni-tr>
								<uni-td align="center">普洗(SUV)</uni-td>
								<uni-td align="center">￥40</uni-td>
							</uni-tr>
							<uni-tr>
								<uni-td align="center">精洗(内饰)</uni-td>
								<uni-td align="center">￥158</uni-td>
							</uni-tr>
							<uni-tr>
								<uni-td align="center">精洗(发动机)</uni-td>
								<uni-td align="center">￥98</uni-td>
							</uni-tr>
							<uni-tr>
								<uni-td align="center">精洗(顶棚)</uni-td>
								<uni-td align="center">￥58</uni-td>
							</uni-tr>
							<uni-tr>
								<uni-td align="center">整车精洗</uni-td>
								<uni-td align="center">￥298</uni-td>
							</uni-tr>
							<uni-tr>
								<uni-td align="center">深度精洗(拆座椅)</uni-td>
								<uni-td align="center">￥398</uni-td>
							</uni-tr>
							<uni-tr>
								<uni-td align="center">抛光单面(门板)</uni-td>
								<uni-td align="center">￥50</uni-td>
							</uni-tr>
							<uni-tr>
								<uni-td align="center">抛光三大面(单面)</uni-td>
								<uni-td align="center">￥100</uni-td>
							</uni-tr>
						</uni-table>
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	import {
		Home
	} from "@/api/api.js"
	export default {
		data() {
			return {
				stausStyle: '',
				list: [{
					name: '车行精致洗车(城南店)',
					price: 180,
					time: 120,
					img: '/static/img/banner3.jpg'
				}],
				banner: []
			}
		},
		onLoad() {
			let info = uni.getWindowInfo()
			this.stausStyle = info.statusBarHeight + 'px'
			this.Home()
		},
		mounted() {

		},

		onUnload() {

		},
		methods: {
			Home() {
				Home().then(res => {
					if (res.status == 1) {
						this.banner = res.data.banner
					}
				})
			},
			noFun() {
				uni.$showMsg('暂未开放')
			},
			toOrder() {
				uni.switchTab({
					url: '/pages/order/index'
				})
			}
		}
	}
</script>

<style lang="scss">
	page {
		background: #f2f2f2;
	}

	.hotlist {
		padding: 10px;

		.hot-item {
			background: #fff;
			border-radius: 8px;
			padding: 10px;
			margin-bottom: 10px;

			.title {
				font-weight: bold;
				font-size: 15px;
				display: flex;
				align-items: center;
				justify-content: space-between;
			}

			.info {
				margin-top: 15px;
				display: flex;

				.imgbox {
					width: 120px;
					height: 85px;

					image {
						width: 120px;
						height: 85px;
					}
				}

				.infobox {
					width: calc(100% - 120px);
					padding-left: 10px;
					box-sizing: border-box;

					.tips {
						font-size: 12px;
						margin-bottom: 5px;

						text {
							margin-right: 3px;
						}
					}

					.tablist {
						display: flex;
						flex-wrap: wrap;

						text {
							margin: 0 3px 3px 0;
							font-size: 12px;
							background: #4F9DFD15;
							color: #4F9DFD;
							border-radius: 3px;
							padding: 1px 3px;

						}
					}
				}
			}

			.price {
				margin-top: 10px;

				.ptitle {
					font-weight: bold;
					font-size: 15px;
				}

				.priceline {
					font-size: 12px;
					margin-top: 5px;
					flex-wrap: wrap;

					text {
						color: #4F9DFD;
						margin-right: 5px;
						font-weight: bold;
					}

					.pli {
						display: flex;
						align-items: center;
						justify-content: space-between;
						font-size: 14px;
						margin-bottom: 5px;
					}
				}
			}
		}
	}

	swiper,
	swiper-item {
		width: 100%;
		height: 21vh;

		.swiper-item {
			width: inherit;
			height: inherit;

			image {
				width: inherit;
				height: inherit;
			}
		}
	}

	.hotitle {
		display: flex;
		align-items: center;
		padding: 0 10px;
		font-weight: bold;
		font-size: 14px;
		margin-top: 20px;

		image {
			width: 20px;
			margin-right: 3px;
		}
	}

	.jg-area {
		display: flex;
		align-items: center;
		justify-content: center;
		padding: 10px;
		width: 96%;
		position: relative;
		z-index: 20;
		margin: 0 auto;
		margin-top: -50px;
		background: #fff;
		border-radius: 5px;
		box-sizing: border-box;
		box-shadow: 0 0 5px #ccc;

		.item {
			display: flex;
			flex-direction: column;
			align-items: center;
			justify-content: center;
			font-size: 14px;
			flex: 1;

			image {
				width: 50px;
			}
		}
	}
</style>